<template>
  <div class="recommend">
    <div v-for="item in recommends" class="recommend-item">
      <a :href="item.link">
        <img :src="item.image" alt="" />
        <div>{{ item.title }}</div>
      </a>
    </div>
  </div>
</template>

<script>
export default {
  name: "RecommendsView",
  props: {
    recommends: {
      type: Array,
      default() {
        return [];
      },
    },
  },
};
</script>

<style>
.recommend {
  display: flex;
  font-size: 12px;
  text-align: center;
  /* 设置子元素主轴上的对齐方式 */
  /* justify-content: space-around; 也可以在子项目上flex-grow：1*/
  /* 设置上下内边距 */
  padding: 15px 0 25px;
  border-bottom: 7px solid rgb(208, 200, 200);
}
.recommend-item {
  flex: 1;
}
.recommend-item img {
  width: 70px;
  height: 70px;
  margin-bottom: 8px;
}
</style>